package com.ccys.cms.controller.masterData;

import com.ccys.cms.service.masterData.CountryHolidayService;
import com.ccys.common.constants.TouristApi;
import com.ccys.common.vo.ResponseResult;
import com.ccys.db.dto.masterData.CountryHolidayDelDto;
import com.ccys.db.dto.masterData.CountryHolidayQueryPageDto;
import com.ccys.db.dto.masterData.CountryHolidaySaveDto;
import com.ccys.db.vo.masterData.CountryHolidayQueryPageVo;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: WhiteCoat
 * @description: 公共假日接口
 * @author: ZhangJingCan
 * @create: 2023-12-11 13:19
 **/

@RestController
@RequestMapping("masterData")
@Api(tags = "masterData-公共假日接口")
public class CountryHolidayController {

    @Autowired
    private CountryHolidayService countryHolidayService;

    
    @PostMapping("countryHoliday")
    @ApiOperation("保存公共假日")
    public ResponseResult save(CountryHolidaySaveDto dto) {
        return countryHolidayService.save(dto);
    }

    @PutMapping("countryHoliday")
    @ApiOperation("修改公共假日")
    public ResponseResult edit(CountryHolidaySaveDto dto) {
        return countryHolidayService.save(dto);
    }
    
    @DeleteMapping("countryHoliday")
    @ApiOperation("根据ID删除")
    public ResponseResult delById(CountryHolidayDelDto dto) {
        return countryHolidayService.delById(dto);
    }

    
    @GetMapping("countryHoliday")
    @ApiOperation("分页查询公共假日")
    public ResponseResult<PageInfo<CountryHolidayQueryPageVo>,Object> findPage(CountryHolidayQueryPageDto dto) {
        return countryHolidayService.findPage(dto);
    }


}
